package cn.kgc.util;

import java.util.List;

/*
分页工具类
        页面所有需要显示的信息都 封装在这里
        查询条件，显示的数据，每页面多少条，多少页，多少条记录……
 */
public class PageDto<T> {
    //给页面
    //每页显示多少条
    private int pageSize;
    //总共多少页面
    private int totalPages;
    //总共多少数据
    private int totalCount;
    //当前页
    private int pageNumber;
    //数据
    private List<T> pageData;
    // 请求地址
    private String urlPath;
    //给后台
    private int start;
    private T querydata;

    //逼方法调用者必须传递pageNumber,totalCount
//    public PageDto(int pageNumber, int totalCount) {
//        this.pageNumber = pageNumber;
//        this.totalCount = totalCount;
//        this.totalPages = (totalCount + pageSize - 1) / pageSize;
//        this.start = (pageNumber - 1) * pageSize;
//    }


    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getTotalPages() {
        return totalPages;
    }

    public void setTotalPages(int totalPages) {
        this.totalPages = totalPages;
    }

    public int getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(int totalCount) {
        this.totalCount = totalCount;
    }

    public int getPageNumber() {
        return pageNumber;
    }

    public void setPageNumber(int pageNumber) {
        this.pageNumber = pageNumber;
    }

    public List<T> getPageData() {
        return pageData;
    }

    public void setPageData(List<T> pageData) {
        this.pageData = pageData;
    }

    public String getUrlPath() {
        return urlPath;
    }

    public void setUrlPath(String urlPath) {
        this.urlPath = urlPath;
    }

    public int getStart() {
        return start;
    }

    public void setStart(int start) {
        this.start = start;
    }

    public T getQuerydata() {
        return querydata;
    }

    public void setQuerydata(T querydata) {
        this.querydata = querydata;
    }
}
